package com.example.administrator.basepro.model.http;


import com.example.administrator.basepro.model.bean.LoginBean;
import com.example.administrator.basepro.model.bean.TableBean;
import com.example.administrator.basepro.model.bean.TableOpeBean;
import com.example.administrator.basepro.model.bean.TableOpeBeanData;
import com.example.administrator.basepro.model.http.api.HangkongApis;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Flowable;
import okhttp3.RequestBody;

/**
 * Created by codeest on 2016/8/3.
 */
public class RetrofitHelper implements HttpHelper {

  private HangkongApis hangkongApis;

    @Inject
    public RetrofitHelper(HangkongApis hangkongApis) {
        this.hangkongApis = hangkongApis;

    }

    @Override
    public Flowable<LoginBean> login(RequestBody requestBody) {
        return hangkongApis.login(requestBody);
    }

    @Override
    public  Flowable<LoginBean> submitSecure(RequestBody bean) {
        return hangkongApis.addTable(bean);
    }

    @Override
    public Flowable<TableBean> getSecureInfo() {
        return hangkongApis.getAllTable();
    }

    @Override
    public Flowable<LoginBean> register(RequestBody requestBody) {
        return hangkongApis.register(requestBody);
    }
}
